﻿<div class="weui-cells weui-cells_form">
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">手机号</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="number" pattern="[0-9]*" placeholder="请输入手机号" id="uphone">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="text" placeholder="请输入姓名" id="uname">
        </div>
    </div>

</div>
<div class="weui-btn-area">
    <a class="weui-btn weui-btn_primary" href="javascript:" id="confirmUpdate">确定修改</a>
</div>

<script>
    $(function () {
        InitInfo();
        function InitInfo() {
            $.ajax({
                type: 'get',
                dataType: "json",
                url: "/M_Main/Get_UserInfoModel",
                success: function (json) {
                    $("#page_loading").hide();
                    $("#uphone").val(json.uphone);
                    $("#uname").val(json.uname)
                },
            });
        }
        $("#confirmUpdate").on("click", function () {
            $("#page_loading").show();
            $.ajax({
                type: 'post',
                dataType: "json",
                data: { uphone: $("#uphone").val(), uname: $("#uname").val(), },
                url: "/M_Main/Update_UserInfo",
                success: function (json) {
                    $("#page_loading").hide();
                    Show_Message(json.msg);
                    if (json.success) {
                        setTimeout(function () { window.location.href = "/V_Main/UserCenter"; }, 2000)
                    }
                },
            });
        })
    })
</script>
